<script type="text/javascript">

$(function(){
	var dataOptions = new Object();
	$("input[name='BusiparataskedTotal']").removeAttr("checked");
	$.get("parameterCard/getCardInfo",function(data){
	
		var contentb="<option value='' selected>请选择</option>";
		var i;
		var html_cardpCode = data.cardpCode;
		if(html_cardpCode){
			contentb="<option value=''>请选择</option>";
			dataOptions["cardPCodeQue"]= html_cardpCode;
		}
		$(data).each(function(n,item){
            
			for(i=0;i<item.cdProDefinitions.length;i++){
				if(item.cdProDefinitions[i].cardpCode==item.cardpCode){
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+" selected>"
					+item.cdProDefinitions[i].cardpName+"</option>"
				}else{
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					+item.cdProDefinitions[i].cardpName+"</option>"
				}
				
			}
			
			$("#cardpNameABM").html(contentb);
			$.post("parameterCard/getCardBusiness",dataOptions,getCardsBusiness,"json");
		});
	},"json");
	
	
	})

//查询按钮绑定事件,查询前，将所有分页信息清空
/* $("#paramQuery").click(function(){
	$("input[name='currentPage']").val("");
	$("input[name='numPerPage']").val("");
	$("input[name='pageCount']").val("");	
}) */
	
/* //刷新每页数量
function paging(){
	var numPerPage=$("#numPerPageBySingleTask").val();
	$("input[name='numPerPage']").val(numPerPage);
	var parm=$("#getCardInfos").serialize();
	$.post("parameterCard/getCardBusiness",parm, getCardBusiness,"json")
};
//下一页
function next(){
	var currentPage=$("input[name='currentPage']").val();
	$("input[name='currentPage']").val(parseInt(currentPage)+1);
	var parm=$("#getCardInfos").serialize();
	$.post("parameterCard/getCardBusiness",parm,getCardBusiness,"json");
};

//上一页
function previous(){
	var currentPage=$("input[name='currentPage']").val();
	$("input[name='currentPage']").val(parseInt(currentPage)-1);
	var parm=$("#getCardInfos").serialize();
	$.post("parameterCard/getCardBusiness",parm,getCardBusiness,"json");
};	 */
//去修改页面
function updateBusiParam(){
	if($("input[name='Busiparatasked']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	if($("input[name='Busiparatasked']:checked").length >=2){
		 alertMsg.warn("不能选择多于1条数据！")
		 return false;
	 }
	var parm="";
	var array;
	$("input[name='Busiparatasked']:checked").each(function(n,item){
		array=$(this).val().split(",")
		parm=array[1];
	})	
	
	//20180319 惠国磊  以下  行   增加
	//将查询条件框中的值传递到对话框
	var cardPCodeByQue = $("#cardpNameABM").val();
	var options={"width":"600","height":"500","cardPCodeByQue":cardPCodeByQue,"param":parm};
	$.pdialog.open("parameterCard/goupdateBusiParamTask","infos", "修改信息",options);
}

function validateCheckBox(){
	if($("input[name='Busiparatasked']:checked").length <= 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	}
    if($("input[name='Busiparatasked']:checked").length > 2){
	      alertMsg.warn("不能选择多于1条数据！")
		 return false; 
	 }
}
</script>
<div class="pageHeader ">
	<form id="pagerForm" method="post"
		action="parameterCard/getCardBusiness"
		class="pageForm required-validate"
		onsubmit="return validateCallback(this,getCardsBusiness);">
		<input type="hidden" name="pageNum" value="" /> <input type="hidden"
			name="numPerPage" value="" />
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>卡产品名称：</label><select id="cardpNameABM" name="cardpCode"
							></select>
					</p>
				</div>
				<div class="col-md-6 col-sm-12"></div>
			</div>

			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>

<form method="post" action="parameterCard/startProduct"
	class="pageForm required-validate"
	onsubmit="return validateCallback(this,navTabAjaxDone);">
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<!-- 	<li><a class="add" href="parameterCard/addBusinessParameters" target="dialog" rel="CardProductDefinition"><span>新增</span></a></li> -->
				<!-- <li><a class="delete" onclick="return deleteBusiParam();"><span>删除</span></a></li> -->
				<li><a class="edit" onclick="return updateBusiParam();"><span>修改</span></a></li>
			</ul>
		</div>
		<!-- <input name="Busiparatasked" type="checkbox" style="display:none" value="xxxxxxxxxxx" checked> -->
		<div id="ByCardBusinessPara">
			<table class="table" width="100%" layoutH="220">
				<thead>
					<tr>
						<!-- <th width="2%" align="center"><input type="checkbox"
							name="BusiparataskedTotal" group="Busiparatasked"
							class="checkboxCtrl"></th> -->
						<th width="3%">选择</th>
						<th width="7%" align="center">序号</th>
						<th width="16%" align="center">卡产品名称</th>
						<th width="9%" align="center">客户唯一持有</th>
						<th width="10%" align="center">领卡天数  </th>
						<th width="9%" align="center">是否允许挂失</th>
						<th width="9%" align="center">是否允许补卡</th>
						<th width="10%" align="center">补卡领卡天数  </th>
						<th width="9%" align="center">是否允许换卡</th>
						<th width="10%" align="center">换卡领卡天数  </th>
						<th width="9%" align="center">是否允许退卡</th>
						<!-- <th width="9%" align="center">创建日期</th>
						<th width="9%" align="center">创建柜员号</th>
						<th width="9%" align="center">最后修改日期</th>
						<th width="9%" align="center">最后修改柜员号</th> -->
					</tr>
				</thead>
				<tbody id="businessCard">

				</tbody>
			</table>
		</div>
		<!-- 	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="numPerPageByBusipara" name="numPerPage" onchange="paging(this,$('#getCardBusinessInfos'),getCardsBusiness)">
				<option value="20">20</option>
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span id="totalCountByBusipara"></span>
		</div>
			<div id="paginationByBusipara" class="pagination1"  ></div>
	</div> -->
		<div class="panelBar">
			<div class="pages">
				<span>显示</span> <select class="combox" name="numPerPage"
					onchange="navTabPageBreak({numPerPage:this.value},'businessCard',getCardsBusiness)">
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
				</select> <span id="totalCountByBusipara">条，共${totalCount}条</span>
			</div>

			<div callback='getCardsBusiness' id="paginationByBusipara"
				rel="businessCard" class="pagination" targetType="navTab"
				totalCount="200" numPerPage="5" pageNumShown="5" currentPage="1"></div>

		</div>
		<!-- <div class="formBar">
			<ul> 
				<li>
					<div class="buttonActive" ><div class="buttonContent" >
					<button type="submit" onclick="return validateCheckBox();" >启用</button></div></div>
				</li>
				<li>
					<div class="buttonActive" ><div class="buttonContent" >
					<button type="submit" onclick="return validateCheckBox();" >停用</button></div></div>
				</li>
			</ul>
		</div>  -->

	</div>
</form>